﻿/*******************************************************************************
 * AAEngine
 * Copyright (c) 2010 Mike Jarosch
 *
 * Original source PushButton Engine:
 * Copyright (C) 2009 PushButton Labs, LLC
 * For more information see http://www.pushbuttonengine.com
 *
 * This file is licensed under the terms of the MIT license, which is included
 * in the "MIT License.txt" file at the root directory of this SDK.
 ******************************************************************************/

namespace AAEngine.Animation
{
    /// <summary>
    /// Class for spritesheet frameIndex animation  ( from start frame number to end frame number )
    /// </summary>
    public class FrameAnimator : Animator
    {
        private int _startFrame, _endFrame;

        /// <summary>
        /// The starting frame number (first frame would be 1) 
        /// </summary>
        public int StartFrame
        {
            get { return _startFrame; }
            set
            {
                _startFrame = value;
                StartValue = value - 1;
            }
        }

        /// <summary>
        /// The ending frame number (maximum would be framecount) 
        /// </summary>
        public int EndFrame
        {
            get { return _endFrame; }
            set
            {
                _endFrame = value;
                TargetValue = value - 0.0001f;
            }
        }
    }
}
